import { Route, Routes, Navigate } from "react-router-dom";

// 引入页面
import Issues from "../pages/Issues";
import IssueDetail from "../pages/IssueDetail";
import AddIssue from "../pages/AddIssue";
import Books from "../pages/Books";
import BookDetail from "../pages/BookDetail";
import Interviews from "../pages/Interviews";
import SearchPage from "../pages/SearchPage";
import Personal from "../pages/Personal";
import NotFound from "../pages/NotFound";

function RouteConfig() {
  return (
    <Routes>
      <Route path="/issues" element={<Issues />} />
      <Route path="/issues/:id" element={<IssueDetail />} />
      <Route path="/add-issue" element={<AddIssue />} />
      <Route path="/books" element={<Books />} />
      <Route path="/books/:id" element={<BookDetail />} />
      <Route path="/interviews" element={<Interviews />} />
      <Route path="/search" element={<SearchPage />} />
      <Route path="/personal" element={<Personal />} />
      <Route path="/" element={<Navigate replace to="/issues" />} />
      <Route path="*" element={<NotFound />} />
    </Routes>
  );
}

export default RouteConfig;
